-
Notifications
You must be signed in to change notification settings - Fork 619
wallet txns activity #6090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wallet txns activity #6090
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
apps/dashboard/src/app/(dashboard)/hackweek/[chain_id]/[address]/hooks/useGetTxActivity.ts
Outdated
Show resolved
Hide resolved
.../dashboard/src/app/(dashboard)/hackweek/[chain_id]/[address]/components/ActivityOverview.tsx
Show resolved
Hide resolved
apps/dashboard/src/app/(dashboard)/hackweek/[chain_id]/[address]/actions/fetchTxActivity.ts
Show resolved
Hide resolved
apps/dashboard/src/app/(dashboard)/hackweek/[chain_id]/[address]/actions/fetchTxActivity.ts
Show resolved
Hide resolved
size-limit report 📦
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## hackweek-wallet-explainer #6090 +/- ##
============================================================
Coverage ? 56.82%
============================================================
Files ? 1152
Lines ? 63904
Branches ? 5180
============================================================
Hits ? 36314
Misses ? 26861
Partials ? 729
*This pull request uses carry forward flags. Click here to find out more. |
| const [isLoading, setIsLoading] = useState(true); | ||
|
|
||
| useEffect(() => { | ||
| (async () => { | ||
| const response = await fetchTxActivity({ chainId, address }); | ||
| const activity = response.map((tx): TxActivityItem => { | ||
| const type = | ||
| tx.to_address?.toLowerCase() === address.toLowerCase() ? "in" : "out"; | ||
| return { | ||
| id: tx.hash, | ||
| type, | ||
| amount: `${tx.value / 10 ** 18} ETH`, | ||
| to: tx.to_address || undefined, | ||
| from: tx.from_address, | ||
| method: tx.function_selector || undefined, | ||
| date: new Date(tx.block_timestamp * 1000).toLocaleString(), | ||
| }; | ||
| }); | ||
| setTxActivity(activity); | ||
| setIsLoading(false); | ||
| })(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace useEffect-based data fetching with useQuery from React Query. The implementation should look like: useQuery(['txActivity', chainId, address], () => fetchTxActivity({chainId, address}), { select: (data) => data.map(tx => ({ ... })) })
Spotted by Graphite Reviewer (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.
Adds a table with
in/outtxns for a walletPR-Codex overview
This PR focuses on updating dependencies, enhancing the handling of transactions, and improving the UI components related to token holdings and activity overview in the dashboard.
Detailed summary
@radix-ui/react-tabsfrompackage.json.clientIdhandling ingetBalance.ts.top_bidstype fromany[]tounknown[]infetchNFTs.ts.SimpleHashResponseinterface infetchNFTs.ts.TokenHoldingscomponent to use unique keys forTableRow.TokenHoldingswith unique keys.useGetTxActivityhook for fetching transaction activities.WalletDashboard.ActivityOverviewto include pagination for transactions.fetchTxActivity.ts.ActivityOverview.